<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>添加/修改经销商信息</title>
<c:import url="/ctrl/simpleheader"></c:import>
<script type="text/javascript" src="/scripts/customer/detail.js"></script>
</head>
<body>
  <div title="经销商信息">
    <div style="padding: 10px 0 10px 60px">
      <table>
        <tr>
          <td>经销商:</td>
          <td><c:choose>
              <c:when test="${cust!=null}">
                <c:out value="${cust.custName}" />
              </c:when>
              <c:otherwise>
                <input type="text" id="name" name="name"
                  style="width: 160px;"></input>
              </c:otherwise>
            </c:choose></td>
        </tr>
        <tr>
          <td>密码:</td>
          <td><input type="password" id="pwd" name="pwd"
            style="width: 100px;"></input></td>
        </tr>
        <tr>
          <td>EMAIL:</td>
          <td><input type="text" id="email" name="email"
            value="<c:out
                      value="${cust.custEmail}" />"
            style="width: 300px;"></input></td>
        </tr>
        <tr>
          <td>来源:</td>
          <td><select id="from" name="from"><c:forEach
                var="from" items="${fromList}">
                <option
                  value="<c:out
                      value="${from.index}" />"
                  <c:if test="${from.index==cust.custFrom}"> selected="selected"</c:if>>
                  <c:out value="${from.name}" /></option>
              </c:forEach></select></td>
        </tr>
        <tr>
          <td>类别:</td>
          <td><select id=type name="type"><c:forEach
                var="type" items="${typeList}">
                <option
                  value="<c:out
                      value="${type.index}" />"
                  <c:if test="${type.index==cust.custTypeFid}"> selected="selected"</c:if>>
                  <c:out value="${type.name}" /></option>
              </c:forEach></select></td>
        </tr>
        <tr>
          <td>等级:</td>
          <td><select id="level" name="level"><c:forEach
                var="level" items="${levelList}">
                <option
                  value="<c:out
                      value="${level.levelId}" />"
                  <c:if test="${level.levelId==cust.custLevelFid}"> selected="selected"</c:if>>
                  <c:out value="${level.levelName}" /></option>
              </c:forEach></select></td>
        </tr>
        <tr>
          <td>状态:</td>
          <td><c:forEach var="status" items="${statusList}">
              <input type="radio" name="status"
                value="<c:out
                      value="${status.index}" />"
                <c:if test="${status.index==cust.custStatus}"> checked="checked"</c:if>>
              <c:out value="${status.name}" />&nbsp;
          </c:forEach></td>
        </tr>
        <tr>
          <td>联系人姓名</td>
          <td><input type="text" name="contactName"
            id="contactName"
            value="<c:out value="${custExt.extContactName}"/>" /></td>
          <td>联系人电话</td>
          <td><input type="text" name="contactTel" id="contactTel"
            value="<c:out value="${custExt.extContactTel}"/>" /></td>
        </tr>
        <tr>
          <td colspan="2">其他信息</td>
        </tr>
        <tr>
          <td>其他联系方式</td>
          <td><input type="text" name="contactOthers"
            id="contactOthers"
            value="<c:out value="${custExt.extContactOthers}"/>" /></td>
          <td>公司名称</td>
          <td><input type="text" name="companyName"
            id="companyName"
            value="<c:out value="${custExt.extCompanyName}"/>" /></td>
        </tr>
        <tr>
          <td>公司邮编</td>
          <td><input type="text" name="companyZip" id="companyZip"
            value="<c:out value="${custExt.extCompanyZip}"/>" /></td>
          <td>公司地址</td>
          <td><input type="text" name="companyAddress"
            id="companyAddress"
            value="<c:out value="${custExt.extCompanyAddress}"/>" /></td>
        </tr>
        <tr>
          <td>公司电话</td>
          <td><input type="text" name="companyTel" id="companyTel"
            value="<c:out value="${custExt.extCompanyTel}"/>" /></td>
          <td>公司传真</td>
          <td><input type="text" name="companyFax" id="companyFax"
            value="<c:out value="${custExt.extCompanyFax}"/>" /></td>
        </tr>
        <tr>
          <td>公司邮箱</td>
          <td><input type="text" name="companyEmail"
            id="companyEmail"
            value="<c:out value="${custExt.extCompanyEmail}"/>" /></td>
          <td>公司网站</td>
          <td><input type="text" name="companyWebsite"
            id="companyWebsite"
            value="<c:out value="${custExt.extCompanyWebsite}"/>" /></td>
        </tr>
        <tr>
          <td>公司注册号</td>
          <td><input type="text" name="companyReg" id="companyReg"
            value="<c:out value="${custExt.extCompanyReg}"/>" /></td>
          <td>负责人姓名</td>
          <td><input type="text" name="chargeName" id="chargeName"
            value="<c:out value="${custExt.extChargeName}"/>" /></td>
        </tr>
        <tr>
          <td>了解途径</td>
          <td colspan="3"><c:forEach var="from"
              items="${extfromList}">
              <input type="radio" name="extfrom"
                value="<c:out value="${from.name}" />"
                <c:if test="${custExt.extFrom==from.name}">checked="checked"</c:if> />
              <c:out value="${from.name}" />
            </c:forEach></td>
        </tr>
      </table>
    </div>
    <div style="text-align: center; padding: 5px">
      <c:choose>
        <c:when test="${cust!=null}">
          <a href="javascript:void(0)"
            onclick="submitModify('<c:out
              value="${cust.custId}" />')">保存</a>
        </c:when>
        <c:otherwise>
          <a href="javascript:void(0)" onclick="submitCreate()">添加经销商</a>
        </c:otherwise>
      </c:choose>
    </div>
  </div>
</body>
</html>